ModEditor.GUI.Button = {}

function ModEditor.GUI.Button:DrawEverything(x,y)
	if self.MouseOver then
		set_color(self.OverColor[1],self.OverColor[2],self.OverColor[3],self.OverColor[4])
	else
		set_color(self.Color[1],self.Color[2],self.Color[3],self.Color[4])
	end
	draw_quad(x,y,self.Width,self.Height)
	set_color(0,0,0,1)
	draw_text(self.Caption,x,y)
end
function ModEditor.GUI.Button:Activate()
	self.Activated = true
end
function ModEditor.GUI.Button:Deactivate()
	self.Activated = false
end
function ModEditor.GUI.Button:MouseDown(x,y)
	if self.OnClick ~= nil then
		self:OnClick()
	end
end
function ModEditor.GUI.Button:New(parent)
	local obj = ModEditor.GUI.BasicControl:New(parent)
	obj.Activate = self.Activate
	obj.Deactivate = self.Deactivate
	obj.MouseDown = self.MouseDown
	obj.DrawEverything = self.DrawEverything
	obj.Color = {1,1,1,1}
	obj.OverColor = {0.75,0.75,0.75,1}
	obj.Caption = "Button"
	obj.OnClick = nil
	return obj
end
